 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/inc/taglib.inc"%>
<%@ include file="/WEB-INF/inc/script.inc"%>


<!DOCTYPE html>
<html>

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="${base}">
<title>中金通 | 新增资产配置</title>

<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="font-awesome/css/font-awesome.css" rel="stylesheet">

<!-- FooTable -->
<!-- <link href="css/plugins/footable/footable.core.css" rel="stylesheet"> -->
<!-- Data Tables -->
<link href="css/plugins/dataTables/dataTables.bootstrap.css"
	rel="stylesheet">
<link href="css/plugins/dataTables/dataTables.responsive.css"
	rel="stylesheet">
<link href="css/plugins/dataTables/dataTables.tableTools.min.css"
	rel="stylesheet">
<link href="css/plugins/datapicker/datepicker3.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="js/plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet">
   <style>
  		.input-group  .form-control[readonly]{
			background-color: #fff;
			opacity: 1;
		}
		.form-control[readonly]{
			background-color: #fff;
			opacity: 1;
			border: 1px solid #fff;
		}
		textarea {
		    resize: none;
		}
		.form-control2{
			    background-color: #FFFFFF;
			    background-image: none;
			    color: inherit;
			    display: block;
			    padding: 6px 12px;
			    width: 100%;
			    font-size: 14px;
		}
    </style>
</head>

<body>

	<div id="wrapper">

		<!-- 左侧菜单 -->
		<jsp:include page="/WEB-INF/jsp/common/main-menu.jsp"></jsp:include>
		<div id="page-wrapper" class="gray-bg">
			<div class="row border-bottom">
				<!-- 头部工具栏区 -->
				<jsp:include page="/WEB-INF/jsp/common/main-header.jsp"></jsp:include>
			</div>
			<div class="row wrapper border-bottom white-bg page-heading">
				<div class="col-lg-10">
					<h2>资产配置</h2>
					<ol class="breadcrumb">
						<li><a href="common/platform">Home</a></li>
						<li><a href="assetAllocation/list">资产配置</a></li>
						<li class="active"><strong>新增资产配置</strong></li>
					</ol>
				</div>
				<div class="col-lg-2"></div>
			</div>
			<div class="row" style="margin-top: 10px;">
				<div class="col-md-12">
					<div class="tabs-container">
					<ul class="nav nav-tabs">
							<li class="active">
								<a href="assetAllocation/add/${productId}">
									 新增资产配置
								</a>
							</li>
                        </ul>
						<div class="tab-content">
							<div class="tab-pane active">
								<div class="panel-body">
									<div class="wrapper wrapper-content animated fadeInRight ecommerce">
									<form action="" method="post" id="addForm"
												enctype="multipart/form-data" 
												class="form-horizontal">
										<input type="hidden" id="assetAllocationId" value="">
			                            <div class="row">
			                            	<div class="col-sm-8">
												<div class="form-group">
													<label class="col-sm-3 control-label"><font
														color="red">*&nbsp;&nbsp;</font>产品名称:</label>
													<div class="col-sm-6">
														<div class="form-control2">${productName}</div>
														<input type="hidden" id="productId" name="productId" value="${productId}">
													</div>
												</div>
			                                </div>
			                              </div> 
			                              <div class="row">
											<div class="col-sm-8">
												<div class="form-group">
													<label class="col-sm-3 control-label"><font
														color="red">*&nbsp;&nbsp;</font>本地资产配置名称:</label>
														<div class="col-sm-6">
														<div class="input-group">
														<input type="text" id="name" name="name"
															placeholder="本地资产配置名称" class="form-control"  value="">
														<span class="input-group-btn"> 
															<button type="button" id="assetAllocation" class="btn btn-primary">添加</button> 
														</span>
														</div>
														</div>
												</div>
			                                </div>
										</div>
										
			                            <div class="row" id="assetAllocationDetailRow" style="display:none" >
			                            	<div class="hr-line-dashed"></div>
			                                <div class="col-sm-12">
												<div class="form-group">
													<button type="button" id="assetAllocationDetailAdd" class="btn btn-primary">添加一条</button>
													<table id="assetAllocationDetailEditable"
															class="table table-striped table-bordered table-hover">
															<thead>
																<tr>
																	<th>编号</th>
																	<th>项目名称</th>
																	<th>项目拟配置金额</th>
																	<th>历史已配置金额</th>
																	<th>收款人</th>
																	<th>收款银行</th>
																	<th>银行卡号</th>
																	<th>本期配置金额</th>
																	<th>备注</th>
																	<th>操作</th>
																</tr>
															</thead>
															<tbody>
															</tbody>
														</table>
												</div>
			                                </div>
			                              </div>  
										<div class="hr-line-dashed"></div>
		                              	<div class="form-group">
		                                  <div class="col-sm-4 col-sm-offset-5">
		                                      <button class="btn btn-primary" id="submitAsset" style="display:none" type="button">提交审核</button>
		                                  </div>
		                              	</div>
									</form>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- 底部版权 -->
			<jsp:include page="/WEB-INF/jsp/common/main-footer.jsp"></jsp:include>
		</div>
		
		<!-- 新填资产配资明细页面 -->
		<div class="modal inmodal" id="addModal" tabindex="-1" role="dialog"
			aria-hidden="true">
			<div class="modal-dialog modal-md">
				<div class="modal-content animated fadeIn">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal">
							<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
						</button>
						<h4 class="modal-title">新增一笔资产配置</h4>
					</div>
					<div class="modal-body">
						<form action="" class="ibox-content p-xl" id="addDetailForm">
                            <div class="row">
									<div class="form-group">
										<div class="col-sm-3">
										<label class="detail-title">项目</label>
										</div>
										<div class="col-sm-6">
											<select id="projectId" class="form-control m-b" name="projectId" >
				                              <c:if test="${projectList.size() != 0}">
												<c:forEach var="i" begin="0" end="${projectList.size()-1}">
								                	<%-- <c:if test="${projectList.get(i).getSelected() == true}">
									                	<option value="${projectList.get(i).getId()}" selected="selected">${projectList.get(i).getName()}</option>
									                </c:if> --%>
									                <c:if test="${i == 0}">
									                	<option value="${projectList.get(i).getId()}" selected="selected">${projectList.get(i).getName()}</option>
									                </c:if>
									                <c:if test="${i != 0}">
									                	<option value="${projectList.get(i).getId()}">${projectList.get(i).getName()}</option>
									                </c:if>
								                </c:forEach>
							             		</c:if>
				                           </select>
										</div>
									</div>
                            </div>
							<br>
							<div class="row">
									<div class="form-group">
										<div class="col-sm-3">
										<label class="detail-title">本地配置金额:</label>
										</div>
										<div class="col-sm-6">
											<input type="text" name="amount" placeholder="本地配置金额" class="form-control"></input>
										</div>
									</div>
							</div>
							<br>
							<div class="row">
									<div class="form-group">
										<div class="col-sm-3">
										<label class="detail-title">收款账户:</label>
										</div>
										<div class="col-sm-6">
											<input type="text" name="bankName" placeholder="收款账户" class="form-control"></input>
										</div>
									</div>
							</div>
							<br>
							<div class="row">
									<div class="form-group">
										<div class="col-sm-3">
										<label class="detail-title">收款银行:</label>
										</div>
										<div class="col-sm-6">
											<input type="text" value="" name="bankDeposit" placeholder="收款银行" class="form-control"></input>
										</div>
									</div>
							</div>
							<br>
							<div class="row">
									<div class="form-group">
										<div class="col-sm-3">
										<label class="detail-title">银行账号:</label>
										</div>
										<div class="col-sm-6">
											<input type="text" name="bankAccount" placeholder="银行账号" class="form-control"></input>
										</div>
									</div>
							</div>
							<br>
							<div class="row">
									<div class="form-group">
										<div class="col-sm-3">
										<label class="detail-title">备注:</label>
										</div>
										<div class="col-sm-6">
											<textarea name="remark" class="form-control"
															placeholder="备注" rows="10" ></textarea>
										</div>
									</div>
							</div>
							<br>
                        </form>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
						<button type="submit" class="btn btn-primary" id="addConfirm">确认</button>
					</div>
				</div>
			</div>
		</div>
		
		<!-- 修改资产配资明细页面 -->
		<div class="modal inmodal" id="editModal" tabindex="-1" role="dialog"
			aria-hidden="true">
			<div class="modal-dialog modal-md">
				<div class="modal-content animated fadeIn">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal">
							<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
						</button>
						<h4 class="modal-title">修改资产配置</h4>
					</div>
					<div class="modal-body">
						<div id="editBody" class="ibox-content p-xl">
						</div>
						<script id="editTemplate" type="text/x-jquery-tmpl">
						<form action="" class="ibox-content p-xl" id="editDetailForm">
							<input type="hidden" name="id" value="{{= assetAllocationDetail.id}}"></input>
                            <div class="row">
									<div class="form-group">
										<div class="col-sm-3">
										<label class="detail-title">项目</label>
										</div>
										<div class="col-sm-6">
											<select id="projectId" class="form-control m-b" name="projectId" >
											{{each(i,project) projectList}}
									                {{if project.id == assetAllocationDetail.projectId}}
									                	<option value="{{= project.id}}" selected="selected">{{= project.name}}</option>
									                {{/if}}
									                {{if project.id != assetAllocationDetail.projectId}}
									                	<option value="{{= project.id}}">{{= project.name}}</option>
									                {{/if}}
											{{/each}}
				                           </select>
										</div>
									</div>
                            </div>
							<br>
							<div class="row">
									<div class="form-group">
										<div class="col-sm-3">
										<label class="detail-title">本地配置金额:</label>
										</div>
										<div class="col-sm-6">
											<input type="text" name="amount" placeholder="本地配置金额" value="{{= assetAllocationDetail.amount}}" class="form-control"></input>
										</div>
									</div>
							</div>
							<br>
							<div class="row">
									<div class="form-group">
										<div class="col-sm-3">
										<label class="detail-title">收款账户:</label>
										</div>
										<div class="col-sm-6">
											<input type="text" name="bankName" placeholder="收款账户" value="{{= assetAllocationDetail.bankName}}" class="form-control"></input>
										</div>
									</div>
							</div>
							<br>
							<div class="row">
									<div class="form-group">
										<div class="col-sm-3">
										<label class="detail-title">收款银行:</label>
										</div>
										<div class="col-sm-6">
											<input type="text" name="bankDeposit" placeholder="收款银行" value="{{= assetAllocationDetail.bankDeposit}}" class="form-control"></input>
										</div>
									</div>
							</div>
							<br>
							<div class="row">
									<div class="form-group">
										<div class="col-sm-3">
										<label class="detail-title">银行账号:</label>
										</div>
										<div class="col-sm-6">
											<input type="text" name="bankAccount" placeholder="银行账号" value="{{= assetAllocationDetail.bankAccount}}" class="form-control"></input>
										</div>
									</div>
							</div>
							<br>
							<div class="row">
									<div class="form-group">
										<div class="col-sm-3">
										<label class="detail-title">备注:</label>
										</div>
										<div class="col-sm-6">
											<textarea name="remark" class="form-control"
															placeholder="备注" rows="10" >{{= assetAllocationDetail.remark}}</textarea>
										</div>
									</div>
							</div>
							<br>
                        </form>
					</div>
					</script>
					<div class="modal-footer">
						<button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
						<button type="submit" class="btn btn-primary" id="editConfirm">确认</button>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- Mainly scripts -->
	<script src="js/jquery-2.1.1.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
	<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
	<script src="js/jquery.serialize-object.min.js" type="text/javascript"></script>
	<script src="js/plugins/jquery-ui/jquery-ui.min.js"></script>
	<script src="js/plugins/validate/jquery.validate.min.js" type="text/javascript"></script>
	<script src="js/plugins/validate/jquery.validate.messages-zh_CN.js" type="text/javascript"></script>

	<!-- Custom and plugin javascript -->
	<script src="js/inspinia.js"></script>
	<script src="js/plugins/pace/pace.min.js"></script>
	<script src="js/plugins/bootbox/bootbox.min.js" type="text/javascript"></script>
	
	<!-- Data Tables -->
	<script src="js/plugins/dataTables/jquery.dataTables.js"></script>
	<script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>
	<script src="js/plugins/dataTables/dataTables.responsive.js"></script>
	<script src="js/plugins/dataTables/dataTables.tableTools.min.js"></script>

	<!-- Data picker -->
	<script src="js/laydate-master/laydate.js"></script>
	<!-- Clock picker -->
	<script src="js/jquery.tmpl.min.js"></script>
 	<script src="js/asset/asset-add.js?v=${jsVersion}"></script>
	<script>
		$(document).ready(function() {
			AssetAdd.init();
		});
	</script>

</body>

</html>
